package service

import "bc/dao"

type ino struct {

}

func (t *ino)Create(d map[string]interface{}) (int){

	b,id := dao.InsOffer.Create(d)
	if b == false{
		return 0
	}
	return id

}
func (t *ino)Delete(w map[string]interface{}) bool {
	b := dao.InsOffer.Delete(w)
	return b
}
func (t *ino) Update (w map[string]interface{},f map[string]interface{}) bool {
	b := dao.InsOffer.Update(w,f)
	return b
}
func (t *ino) First(w map[string]interface{}) (*dao.Instance_offering){

	b,ins := dao.InsOffer.First(w)
	if b == true{
		return ins
	}
	return nil

}
func (t *ino) Find(w map[string]interface{},page int,pageSize int) ([]*dao.Instance_offering,int){

	ins,total,err := dao.InsOffer.Find(w,page,pageSize)
	if err != nil{
		return nil,0
	}
	return ins,total

}

var InsOffer = &ino{}
